<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="container-fluid px-0">
<div class="row">
	<div class="col-lg-12">
		<div class="card card-threadlist">
			<div class="card-body">
                <?php if ($type == 1 && $page > $count) {?>
                <div class="form-group text-center">
                    <?php echo ($page - 1) * 20000; ?> data has been created
                </div>
                <?php } else { ?>
                <form action="<?php echo url('other-increase'); ?>" method="post" id="form">
                    <div class="form-group">
                        <div class="row justify-content-between m-0">
                            <select class="custom-select mr-1 w-auto" name="fid">
                                <?php if (!empty($columnlist)) {foreach ($columnlist as $forum) { ?>
                                <option value="<?php echo $forum['fid']; ?>"><?php echo $forum['name']; ?></option>
                                <?php }} ?>
                            </select>
                            <?php if ($installed) { ?>
                            <div>
                                <a class="truncate btn btn-danger btn-sm text-white" href="javascript:void(0)"> <?php echo lang('unload_data');?> </a>
                            </div>
                            <?php } ?>
                        </div>

                    </div>
                    <div class="form-group">
                        <?php echo form_radio('n', array(lang('one_million'),lang('five_million'),lang('ten_million'),lang('fifty_million'),lang('one_hundred_million')));?>
                        <p class="small text-muted my-3">
                            <?php echo lang('increase').lang('thread').lang('confirm_databese_sufficient_tips');?>
                        </p>
                    </div>
                    <div class="form-group text-center mt-4">
                        <a class="create btn btn-primary btn-block text-white col-md-3 mx-auto" href="javascript:void(0)"> <?php echo lang('submit');?> </a>
                    </div>
                </form>
                <?php } ?>
			</div>
		</div>
	</div>
</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
    var form = $('#form');
    <?php if ((empty($runtime['articles']) && empty($installed)) || ($runtime['articles'] && $installed == 1)) { ?>
    form.on('click', 'a.create', function() {
        var fid = $('select[name="fid"]').checked();
        var n = $('input[name="n"]').checked();
        if (!fid) $.alert('Fid is empty');
        window.location = xn.url('other-increase') + '?type=1&fid=' + fid + '&n=' + n;
        return false;
    });
    <?php } ?>

    <?php if ($installed == 1) { ?>
    form.on('click', 'a.truncate', function() {
        $.xpost(xn.url('other-increase'), {type:1}, function(code, message) {
            if(code == 0) {
                $.alert(message);setTimeout(function() {
                    window.location.reload();
                }, 1000);
            } else {
                $.alert(message);
            }
        });
        return false;
    });
    <?php } ?>

    $('#other').addClass('show');
    $('.sidebar-sticky li.menu-increase').addClass('active').prepend('<div class="arrow-tips float-right d-none d-md-block"></div>');
</script>